﻿using System;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
@TestRunner.Imports


namespace @Test.Namespace
{
	
	public partial class @Test.ClassName
	{


@{
	foreach (var constructor in Class.Constructors.Where(c => c.IsCreatable)) 
	{ 
		<text>
		
        @Tag("IDisposable")
    	@TestAttribute
		public void @(Test.ClassName + "_DisposeTwice_" + constructor.SafeName)()
        {
			IDisposable objectUnderTest = @constructor.GetConstructorCode();

			try
			{
				objectUnderTest = @constructor.GetConstructorCode();
			}
			catch (ArgumentException)
			{
                return; //cannot continue test
			}

            objectUnderTest.Dispose();
            objectUnderTest.Dispose(); //second call should be a no-op 
		}
				
		</text>	
	}	
}
	}
}

